package com.kfgj.hkp.entity.systemconfig;

import com.kfgj.hkp.common.context.CurrentContext;
import com.kfgj.hkp.common.service.AbstractDto;
import com.kfgj.hkp.entity.user.UserEntity;

import java.util.ArrayList;
import java.util.List;

public class IgnoreRegionConfig extends AbstractDto {

    private List<String> deptLists = new ArrayList<>();

    private List<String> postLists = new ArrayList<>();

    private List<String> userLists = new ArrayList<>();

    public List<String> getDeptLists() {
        return deptLists;
    }

    public void setDeptLists(List<String> deptLists) {
        this.deptLists = deptLists;
    }

    public List<String> getPostLists() {
        return postLists;
    }

    public void setPostLists(List<String> postLists) {
        this.postLists = postLists;
    }

    public List<String> getUserLists() {
        return userLists;
    }

    public void setUserLists(List<String> userLists) {
        this.userLists = userLists;
    }

    public  boolean check(){
        UserEntity info = (UserEntity) CurrentContext.getUserInfo();
        if (this.deptLists.contains(info.getOwnerDeptCode())
                || this.postLists.contains(info.getEmpPostCode())
                || this.userLists.contains(info.getUserCode())){
            return true;
        }
        return false;
    }
}
